package com.sptus.web.util;

import cn.hutool.crypto.digest.BCrypt;

public class CryptUtil {
    /**
     * 加密
     */
   public  static  String   encodedPassword(String password ) {
        // 加密
       return  BCrypt.hashpw(password, BCrypt.gensalt());
    }
    /**
     * 验证正确密码
     */
    public  static  boolean   checkTruePassword(String password,String encodedPassword ) {
       return BCrypt.checkpw(password, encodedPassword);
    }

    public static void main(String[] args) {

        System.out.println( CryptUtil.encodedPassword("123456"));
    }
}
